<!--自由课程调查页-->
<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="format-detection" content="telephone=no" />
		<meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
		<script src="../../script/mui.min.js"></script>
		<script src="../../script/jquery.min.js"></script>
		<link rel="stylesheet" href="../../css/mui.min.css" />
		<link rel="stylesheet" href="../../css/swiper-3.4.2.min.css">
		<link rel="stylesheet" type="text/css" href="../../css/weui.min.css">
		<link rel="stylesheet" href="../../css/base.css"/>
		<link rel="stylesheet" href="../../css/exam.css">
		<link rel="stylesheet" type="text/css" href="../../css/people_diaocha.css"/>
		<link rel="stylesheet" type="text/css" href="../../css/singlePeo_diaocha.css"/>
		<title>老师端调查列表详情页</title>
		<script type="text/javascript" charset="utf-8">
			mui.init();
		</script>
		<style>
			html {
				font-size: 10px;
			}
			.question_main .question_answer {
				padding: 0.2rem 0rem 0rem 2.7rem;
				background: #fff;
				margin-bottom: 20px;
			}
			.diaocha_question:nth-child(1) {
				padding-top: 10px;
			}
			.question_title {
				font-size: 16px;
				color: #333333;
				padding: 0.5rem 1.5rem 1rem 1.5rem;
			}
			.weui_mask {
				position: fixed;
				z-index: 998;
				top: 0;
				right: 0;
				bottom: 0;
				left: 0;
			}
			.weui_dialog {
				z-index: 999;
			}
			.swiper-wrapper {
				min-height: 40rem
			}
		</style>
	</head>
	<body >
		<div class="base_style_color" id='BarAppearance' style="height: 22px;width: 100%; position:fixed; left: 0px;top:0px;z-index: 998" ></div>
		<div class="base_navigation_bar base_style_color base_navigation_item_bar" style="position: fixed;left: 0px;top: 20px;">
			<a class="base_left_item" href="#" onclick="backToast()"> <img class="base_back_icon" src="../../image/icon_jiantou.png" alt=""> </a>
			<span id="title"></span>
			<!--<a class="base_right_item top_0" href="#popover-card"> 答题卡</a>-->
			<a class="base_right_item " id="describe"  onclick="openBewrite()" style="display: none;"> 描述</a>
		</div>
		<div class="stu-test" id="scroll">
			<div class="ReviewWeekly_div  " style="margin-top: 64px"></div>
			<div class="space10"></div>
			<div class="k-con test-m-bottom70 test-analysis" id="question_div">
				<div class="question_main">
					<div class="swiper-container">
						<div class="swiper-wrapper" ></div>
					</div>
				</div>
			</div>
			<div class="k-con1 k-text-center k-fixed-bottom test-bottom1" id="sub_div">
				<div class="k-con-part1" id='sub_bt' style="display: none">
					<button type="button" class="mui-btn mui-btn-primary" onclick="CheckSubmit()">
						提交
					</button>
					<div class="test_card_div">
						<a class="base_right_item "style="color: #18B4ED" href="#popover-card">答题卡 </a>
					</div>
				</div>
				<div class="k-con-part" id='score_bt' style="height:27px;display: none;">
					<div class="test_card_div" style="top: -10px">
						<a class="base_right_item "style="color: #18B4ED" href="#popover-card">答题卡 </a>
					</div>
				</div>
			</div>
			<div id="popover-card" class="mui-popover test-num-card" style="width: 97% ">
				<div class="mui-scroll-wrapper">
					<div class="mui-scroll" id="scroll-card"></div>
				</div>
			</div>
			<div id="backAlert" class="weui_dialog_confirm" style="display: none">
				<div class="weui_mask"></div>
				<div class="weui_dialog">
					<div class="weui_dialog_hd">
						<strong class="weui_dialog_title" id="checkNum"></strong>
					</div>
					<div class="weui_dialog_bd"></div>
					<div class="weui_dialog_ft">
						<a onclick="cleanCancel()" href="#" class="weui_btn_dialog default"  style="color:#18b4ed">取消</a>
						<a onclick="cleanConfirm()" href="#" class="weui_btn_dialog primary"  style="color:#18b4ed">确定</a>
					</div>
				</div>
			</div>
			<div class="weui_dialog_alert" id="closeAlert" style="display: none">
				<div class="weui_mask"></div>
				<div class="weui_dialog">
					<div class="weui_dialog_hd">
						<strong class="weui_dialog_title" id="checkNum2"></strong>
					</div>
					<div class="weui_dialog_ft">
						<a onclick="Cancel()" href="#" class="weui_btn_dialog primary"  style="color:#18b4ed">确定</a>
					</div>
				</div>
			</div>
		</div>
	</body>
	<script type="text/javascript" src="../../script/api.js"></script>
	<script src="../../script/jquery.min.js" type="text/javascript"></script>
	<script src="../../script/timecontrol.min.js"></script>
	<script type="text/javascript" src="../../script/MD5.js"></script>
	<script src="../../script/swiper-3.4.2.jquery.min.js" type="text/javascript"></script>
	<script type="text/javascript" src="../../script/requestTool.js"></script>
	<script type="text/javascript" src="../../script/echarts.min.js"></script>
	<script src="../../script/common.js"></script>
	<script>
		//题目名称数组
		var daan = new Object();
		var answerArr = new Array();
		var question_typeArr = new Array();
		var itemNameArr = new Array();
		var qidArr = new Array();
		var nullQuestionArr = new Array();
		var pid = "";
		// 计划id
		var cid = "";
		var clickNum = "";
		//课程id
		var chapterid = "";
		//章节id
		var timeNum = "";
		var questionLen = "";
		var clickNum2 = '';
		var currentStatus = 1;
		apiready = function() {
			var pageParam = api.pageParam;
			var h = api.winHeight * 0.3;
			$('#popover-card').css('height', h);
			$('#title').text(api.pageParam.name);
			scrollUI();
			sendBuriedNotifi('0', '学生端调查页', '177');
			//开启加载框
			showProgress();
			prepareData();
			setTimeout(function() {
				setupInputShowOrHide();
			}, 500);
			ReceNotifi();
			// 滚动监听
			listenScroll();
		}
		function sendBuriedNotifi(busionessid, pagetype, pagetypeid) {
			var userinfo = {
				uid : $api.getStorage('cfnetppuid'),
				jid : $api.getStorage('cfnetppjxid'),
				uname : $api.getStorage('cfnetppusername'),
			}
			var data = {
				busionessid : busionessid,
				pagetype : pagetype,
				pagetypeid : pagetypeid,
				sourceurl : api.pageParam.sourceurl,
				sourcetitle : api.pageParam.sourcetitle,
				accesspageurl : window.location.pathname,
				accesspagetitle : document.title,
				userinfo : userinfo
			}
			SendBehaviorTrajectoriesNotifi_Study(data);
		}
		//准备考试数据
		function prepareExamData() {
		
			if (currentStatus == 0) {//未开始
				loadExamData(0)//只能看题目,不能提交
			} else if (currentStatus == 1) {//进行中
				if (api.pageParam.userstatus != 10) {//未参加
					loadExamData(1)//能提交
				} else {//已参加
					loadScoreData();
				}
			} else if (currentStatus == 2) {//已结束
				loadScoreData();
			}
		}

		//获取当前调查活动状态
		function prepareData() {
			currentStatus = api.pageParam.activity_status;
		}

		//设置当前考试页隐藏或者消失
		function setupInputShowOrHide() {
		    $(".swiper-wrapper").html('');
			$("#scroll-card").html('');
			prepareExamData()
		}

		//接收通知
		function ReceNotifi() {
			api.addEventListener({
				name : 'keyback'
			}, function(ret, err) {
				//coding...
				backToast();
			});
			api.addEventListener({
				name : 'pushMessage_classroomMessage'
			}, function(ret, err) {
				var id = ret.value.id;
				if (id == api.pageParam.id) {
					var status = ret.value.status;
					currentStatus = status;
					prepareUI();
					setupInputShowOrHide();
				}
			});
		}

		//初始化ui布局
		function prepareUI() {
			$('#sub_bt').hide();
		}

		//开启弹窗
		function PopupHint2(str) {
			$("#checkNum2").text(str);
			$('#closeAlert').show();
		}

		//是否关闭当前弹窗确定按钮
		function Cancel() {
			$('#closeAlert').hide();
			if (clickNum2 == 7) {
			} else {
				backClick();
			}
		}

		//调查考试页
		function loadExamData(type) {
		
			var param = {
				iid : api.pageParam.id,
			};
			cfnetppPOST(url_getSurveryDetail, param, true, function(data, status) {
			
				hideProgress();
				sendBuriedNotifi('0', '学生端调查页', '177');
				if (status == 'success') {
					if (data.code == 200) {
						var list = data.data;
						if (list != null) {
							if (type == 1) {//正常考试情况
								$('#sub_bt').show();
							} else {
								$('#sub_bt').hide();
							}
							SetExamUI(list);
						} else {
							back('该调查题目为空');
						}
					} else if (data.code == 106) {
						back('调查未找见');
					} else {
					}
				} else {
					api.toast({
						msg : '网络异常',
						duration : 2000,
						location : 'bottom'
					});
				}
			});
		}

		//调查结果页
		function loadScoreData() {
			var param = {
				uid : $api.getStorage('cfnetppuid'),
				iid : api.pageParam.id,
			};
			cfnetppPOST(url_getSurveryResult, param, true, function(data, status) {
				hideProgress();
				sendBuriedNotifi('0', '学生端调查结果页', '178');
				if (status == 'success') {
					if (data.code == 200) {
						$('#score_bt').show();
						var list = data.data;
						if (list != null) {
							SetScoreUI(list);
							clickNum = 4;
						} else {
							api.toast({
								msg : '请在调查活动结束后查看答案，目前暂时不支持查看调查结果',
								duration : 2000,
								location : 'bottom'
							});
						}
					} else if (data.code == 106 || data.code == 108) {
						api.toast({
							msg : '调查未找见',
							duration : 2000,
							location : 'bottom'
						});
					} else {
						api.toast({
							msg : '没有更多数据了',
							duration : 2000,
							location : 'bottom'
						});
					}
				} else {
					api.toast({
						msg : '网络异常',
						duration : 2000,
						location : 'bottom'
					});
				}
			});
		}

		//解决底部按钮被输入框遮挡的问题
		function listenScroll() {
			var winHeight = $(window).height();
			//获取当前页面高度
			$(window).resize(function() {
				var thisHeight = $(this).height();
				if (winHeight - thisHeight > 50) {
					//当软键盘弹出，在这里面操作
					$("#sub_div").css('display', 'none');
				} else {
					$("#sub_div").css('display', 'block');
					//当软键盘收起，在此处操作
				}
			});
		}

		//设置考试页面
		function SetExamUI(list) {
			var data = list.questionitems;
			if (data != null) {
				questionLen = data.length;
				var orderNum = "";
				for (var i = 0; i < questionLen; i++) {
				orderNum = (i + 1) + '/' + questionLen;
					$(".swiper-wrapper").append('<div class="swiper-slide" id="item' + (i + 1) + '" itemtype="' + data[i].subsecttitle + '"></div>')
					$("#item" + (i + 1)).append('<div class="k-con-part3 clearfix">' + '<span id="itemType" class="k-f18">' + data[i].subsecttitle + '</span>' + '<p class="k-f16 k-c323 k-mt5 indent-5">Q' + orderNum + "." + htmlspecialchars_decode(data[i].titile) + '</p>' + '<div  class="test-answer-list left_15"      onclick="GetAnswerData(' + i + ')" >' + '</div>' + '</div>')
					if (data[i].subsecttitle == '单选题') {
						//	是单选或者判断
						var RadioIndex = '';
						for (var k = 0; k < data[i].options.length; k++) {
							RadioIndex = (Date.parse(new Date())) / 1000 + k;
							if (data[i].options[k].desc.indexOf("img") > 0) {
								$("#item" + (i + 1) + " .test-answer-list").append('<div  class="mui-input-row mui-radio mui-left ">' + '<label>' + data[i].options[k].desc + '</label>' + '<input Itemindex="' + i + '" dataindex="' + (k + 1) + '"   name="radio' + i + '"    type="radio"  >' + '</div> ')
							} else {
								$("#item" + (i + 1) + " .test-answer-list").append('<div  class="mui-input-row mui-radio mui-left ">' + '<label>' + htmlspecialchars_decode(data[i].options[k].desc) + '</label>' + '<input Itemindex="' + i + '"  dataindex="' + (k + 1) + '"   name="radio' + i + '"   type="radio"  >' + '</div> ')
							}
						}
					} else if (data[i].subsecttitle == '多选题') {
						//	是多选
						for (var k = 0; k < data[i].options.length; k++) {
							if (data[i].options[k].desc.indexOf("img") > 0) {
								$("#item" + (i + 1) + " .test-answer-list").append('<div  class="mui-input-row mui-checkbox mui-left">' + '<label>' + data[i].options[k].desc + '</label>' + '<input Itemindex="' + i + '"  dataindex="' + (k + 1) + '"     name="checkbox1" value="Item 1" type="checkbox" >' + '</div>')
							} else {
								$("#item" + (i + 1) + " .test-answer-list").append('<div  class="mui-input-row mui-checkbox mui-left">' + '<label>' + data[i].options[k].desc + '</label>' + '<input Itemindex="' + i + '"   dataindex="' + (k + 1) + '"   name="checkbox1" value="Item 1" type="checkbox" >' + '</div>')
							}
						}
					} else if (data[i].subsecttitle == '论述题') {
						// 论述
						$("#item" + (i + 1) + " .test-answer-list").append('<div  class="test-answer-list">' + '<textarea Itemindex="' + i + '"  class="k-texttarea k-f14" id="content" ></textarea>' + '</div>')
					}
					$(".mui-slider-item  img").width("90%");
					$(".mui-input-row  img").height("50%");
				}
				var mySwiper = new Swiper('.swiper-container', {
					autoHeight : true,
					//					autoplay: 2000,//可选选项，自动滑动
					//用户操作swiper之后，是否禁止autoplay
					autoplayDisableOnInteraction : true,
					//				pagination : '.swiper-pagination',
					direction : 'horizontal',
					loop : false,
				})
				//	生成答题卡题号
				popoverCardNum(questionLen);
				//  试题总数
				allQuestionNum(questionLen);
				// 点击答题卡切换
				$("#popover-card span").on("click", function() {
					var index = $(this).index();
					mySwiper.slideTo(index, 1000, false);
					mui('#popover-card').popover('hide')
				});
			}
		}

		//设置考试结果页面
		function SetScoreUI(list) {
			var data = list;
			questionLen = data.length;
			
			//	生成答题卡题号
			popoverCardNum(questionLen);
			var orderNum="";
			for (var i = 0; i < questionLen; i++) {
			orderNum = (i + 1) + '/' + questionLen;
				$(".swiper-wrapper").append('<div class="swiper-slide">' + '<div class="diaocha_question"  id="item' + (i + 1) + '"  itemtype="' + data[i].subsecttitle + '">' + '</div>' + '</div>');
				$("#item" + (i + 1)).append('<p class="question_title">' + '<span>Q' + orderNum + '</span>' + htmlspecialchars_decode(data[i].title) + '<span class="question_type">' + '(' + data[i].subsecttitle + ')' + '</span>' + '</p>' + '<ul class="question_answer">' + '</ul>');
				if (data[i].subsecttitle == '单选题') {
					for (var k = 0; k < data[i].options.answer.length; k++) {
						var optionStr = "option" + ((k + 1) % 7);
						var BgStr = "Bg" + ((k + 1) % 7);
						var optionStr2 = htmlspecialchars_decode(data[i].options.answer[k].option_title.desc)
						var PercentageStr = PercentageIsNull(((data[i].options.answer[k].option_num) / (data[i].options.answer[k].option_sum)) * 100) + "%";
						$("#item" + (i + 1) + " .question_answer").append('<li>' + '<p style="font-size:14px">' + '<span>' + fromCharCode(k + 1) + '</span>' + '<span class="left_5">' + optionStr2 + '</span>' + '</p>' + '<div class="progressBar ' + optionStr + '">' + '<div class="Bar_left ' + optionStr + '">' + '<div class="bar_in ' + BgStr + '"></div>' + '</div>' + '<div class="Bar_center">' + PercentageStr + '</div>' + '<div class="Bar_right"><img src="../../image/icon_Pmini.png" alt="">' + '<span>' + data[i].options.answer[k].option_num + '</span>' + '</div>' + '</div>' + '</li>');
					}
				} else if (data[i].subsecttitle == '多选题') {
					for (var k = 0; k < data[i].options.answer.length; k++) {
						var optionStr = "option" + ((k + 1) % 7);
						var BgStr = "Bg" + ((k + 1) % 7);
						var optionStr2 = htmlspecialchars_decode(data[i].options.answer[k].option_title.desc)
						var PercentageStr = PercentageIsNull(((data[i].options.answer[k].option_num) / (data[i].options.answer[k].option_sum)) * 100) + "%";
						$("#item" + (i + 1) + " .question_answer").append('<li>' + '<p style="font-size:14px">' + '<span>' + fromCharCode(k + 1) + '</span>' + '<span class="left_5">' + optionStr2 + '</span>' + '</p>' + '<div class="progressBar ' + optionStr + '">' + '<div class="Bar_left ' + optionStr + '">' + '<div class="bar_in ' + BgStr + '"></div>' + '</div>' + '<div class="Bar_center">' + PercentageStr + '</div>' + '<div class="Bar_right"><img src="../../image/icon_Pmini.png" alt="">' + '<span>' + data[i].options.answer[k].option_num + '</span>' + '</div>' + '</div>' + '</li>');
					}
				} else if (data[i].subsecttitle == '论述题') {
					// 论述
					$("#item" + (i + 1) + " .test-answer-list").append('<div  class="test-answer-statistics" id="item">无数据统计</div>')
				}
				GetWidth();
			}
			var mySwiper = new Swiper('.swiper-container', {
				autoHeight : true,
				//用户操作swiper之后，是否禁止autoplay
				autoplayDisableOnInteraction : true,
				//				pagination : '.swiper-pagination',
				direction : 'horizontal',
				loop : false,
			})
			//  试题总数
			// 点击答题卡切换
			$("#popover-card span").on("click", function() {
				//				gallery.slider().gotoItem($(this).index())
				var index = $(this).index();
				mySwiper.slideTo(index, 1000, false);
				mui('#popover-card').popover('hide')
			});
		}

		//得到答案数据
		function GetAnswerData(slideNumber) {
			var duooptionid = '';
			//多选题选项id
			var danoptionid = '';
			//单选题选项id
			var duoQuestionid = '';
			//多选题题目id
			var danQuestionid = '';
			//单选题tiid
			var lunshuQuestionid = '';
			//论述题id
			var Itemindex = '';
			var duoQuestionidArr = new Array();
			var lunshuContent = '';
			var itemtype = $(".swiper-wrapper").children().eq(slideNumber).attr('itemtype');
			if (itemtype == '单选题' || itemtype == '多选题' || itemtype == '判断题') {//单选题,多选题,判断题
				$(".swiper-wrapper").children().eq(slideNumber).find('input').each(function(i) {
					if ($(this).attr('type') === 'radio') {
						if (this.checked == true) {
							danoptionid = $(this).attr('dataindex');
							Itemindex = $(this).attr('Itemindex');
							$("#scroll-card").find("span").eq(Itemindex).removeClass('qusetion-num-normal').addClass('qusetion-num-selected');
							answerArr[Itemindex] = danoptionid;
							question_typeArr[Itemindex] = itemTypeId(itemtype);
						}
					} else if ($(this).attr('type') === 'checkbox') {
						Itemindex = $(this).attr('Itemindex');
						if (this.checked == true) {
							duooptionid = $(this).attr('dataindex');
							Itemindex = $(this).attr('Itemindex');
							$("#scroll-card").find("span").eq(Itemindex).removeClass('qusetion-num-normal').addClass('qusetion-num-selected');
							duoQuestionidArr.push(duooptionid);
						} else {
							duoQuestionidArr.splice(i, 1);
						}
						if (duoQuestionidArr.toString() == "") {
							$("#scroll-card").find("span").eq(Itemindex).removeClass('qusetion-num-selected').addClass('qusetion-num-normal');
							answerArr[Itemindex] = "f";
							question_typeArr[Itemindex] = "f";
						} else {
							answerArr[Itemindex] = duoQuestionidArr;
							question_typeArr[Itemindex] = itemTypeId(itemtype);
						}
					}
				});
			} else {
				$(".swiper-wrapper").children().eq(slideNumber).find('textarea').on('input', function() {
					lunshuQuestionid = $(this).attr('itemid');
					//				//论述题内容
					lunshuContent = $(this).val();
					Itemindex = $(this).attr('Itemindex');
					if (lunshuContent != null && lunshuContent != '') {
						$("#scroll-card").find("span").eq(Itemindex).removeClass('qusetion-num-normal').addClass('qusetion-num-selected');
					}
					answerArr[Itemindex] = lunshuContent;
					question_typeArr[Itemindex] = itemTypeId(itemtype);
				});
			}
		}

		//通过题目类型获取相应id
		function itemTypeId(str) {
			if (str != null && str != '') {
				if (str == '单选题') {
					return 1;
				} else if (str == '多选题') {
					return 2;
				} else if (str == '论述题') {
					return 3;
				}
			}
		}

		//  试题总数
		function allQuestionNum(questionLen) {
			$("#questionLength").text("/" + questionLen)
		}

		//	生成答题卡题号
		function popoverCardNum(questionLen) {
			for (var i = 0; i < questionLen; i++)
				$("#scroll-card").append('<span class="qusetion-num-normal">' + (i + 1) + '</span>')
		}

		//检查题目是否提交
		function CheckSubmit() {
			foreachGetAnswerData(questionLen)
			DeleteAnswerNull();
			var daanLen = answerArr.length;
			var strLen = questionLen - daanLen;
			//			alert(strLen);
			if (strLen == 0) {
				$("#checkNum").text("是否确定提交？");
				$('#backAlert').show();
				clickNum = 1;
			} else {
				clickNum2 = 7;
				PopupHint2("您还有" + strLen + "道题未填写,请填写");
			}
		}

		//退出考试提示
		function backToast() {
		    
			if (clickNum == 4) {
				returnList('Student_ResearchWindow');
			} else {
				$('#backAlert').show();
				if ($api.getStorage('cfnetppjxid') != 425) {
					$("#checkNum").text("是否确定退出本次调查?");
				} else {
					$("#checkNum").text("是否确定退出本次投票?");
				}
				clickNum = 2;
			}
		}

		//取消按钮
		function cleanCancel() {
			$('#backAlert').hide();
		}

		//确定
		function cleanConfirm() {
			$('#backAlert').hide();
			if (clickNum == 1) {
				SubmitData();
			} else if (clickNum == 2 || clickNum == 4) {
				returnList('Student_ResearchWindow');
			}
		}

		//返回到指定的页
		function returnList(str) {
			if (currentStatus == 0) {//未开始
				sendBuriedNotifi('1', '学生端调查页', '177');
			} else if (currentStatus == 1) {//进行中
				if (api.pageParam.userstatus != 10) {//未参加
					sendBuriedNotifi('1', '学生端调查页', '177');
				} else {//已参加
					sendBuriedNotifi('1', '学生端调查结果页', '178');
				}
			} else if (currentStatus == 2) {//已结束
				sendBuriedNotifi('1', '学生端调查结果页', '178');
			}
			api.closeToWin({
				name : str
			});
		}

		//遍历获取答案，避免因为操作导致数据获取失败
		function foreachGetAnswerData(questionLen) {
			for (var k = 0; k < questionLen; k++) {
				GetAnswerData(k);
			}
		}

		//删除提交数据为null的数组
		function DeleteAnswerNull() {
			for (var k = 0; k < answerArr.length; k++) {
				if (isEmpty(answerArr[k]) || answerArr[k] == "f") {
					answerArr.splice(k, 1);
					k = k - 1;
				}
			}
			for (var j = 0; j < question_typeArr.length; j++) {
				if (isEmpty(question_typeArr[j])) {
					question_typeArr.splice(j, 1);
					j = j - 1;
				}
			}
		}

		//提交答题数据
		function SubmitData() {
			var param = {
				iid : api.pageParam.id,
				stuid : $api.getStorage('cfnetppuid'),
				answer : answerArr,
				question_type : question_typeArr,
			};
			if (answerArr.length == 0) {
				ShowToast('调查不可以提交空卷');
			} else {
				cfnetppPOST(url_postSurveryDetail, param, false, function(data, status) {
					SendBusinessOperationsLogNotifi('学生提交调查', '177', param, param, '', data, '学生提交调查接口', '177-01')
					hideProgress();
					if (status == 'success') {
						if (data.code == 200) {
							ShowToast(data.remind.content);
							sendNotifi();
							openScore();
						} else if (data.code == 125) {
							ShowToast('请勿重复提交');
						} else {
							api.toast({
								msg : '提交失败',
								duration : 2000,
								location : 'bottom'
							});
						}
					} else {
						api.toast({
							msg : '请求失败',
							duration : 2000,
							location : 'bottom'
						});
					}
				});
			}
		}

		//发送通知
		function sendNotifi() {
			api.sendEvent({
				name : 'RefreshReasearchList'
			});
		}

		//打开考试结果页
		function openScore() {
			var y = 0;
			var h = api.winHeight - y;
			api.openWin({useWKWebView:true,
				name : 'Student_ResearchExam',
				url : 'Student_ResearchExam.html',
				rect : {
					x : 0,
					y : y,
					w : 'auto',
					h : h,
				},
				pageParam : {
					id : api.pageParam.id,
					name : api.pageParam.name,
					activity_status : currentStatus,
					userstatus : 10,
					sourceurl : window.location.pathname,
					sourcetitle : document.title
				},
				reload : true
			});
		}
	</script>
</html>